package cn.openea.perpartner.meily.web.mapper;

import cn.openea.perpartner.meily.web.entity.User;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.yulichang.base.MPJBaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * (User)表数据库访问层
 *
 * @author Weird077
 * @since 2023-03-15 16:17:55
 */
public interface UserMapper extends MPJBaseMapper<User> {

    @Select("select distinct u.*" +
            " from meily_user u" +
            " left join meily_user_role ur on u.user_id = ur.user_id" +
            " left join meily_role r on r.role_id = ur.role_id where ${ew.customSqlSegment}")
    List<User> selectUnallocatedList(@Param("ew") QueryWrapper<User> wrapper);
}

